# esimate parameters in Log-Gaussian point process model
# 
# Author: guochun
###############################################################################


agModeling.logGaussianM=function(modelingObject){
	fittedModel=inhomK(modelingObject)
	#here sigma2 represents sigma^2
	PlogG=lgcp.estK(attr(fittedModel,"K"), c(sigma2=0.1, alpha=1),
			rmax=attr(fittedModel,"rmax"),rmin=0)
	pnames=names(PlogG$par)
	p1=new("parameter",name=pnames[1],value=as.numeric(PlogG$par[1]))
	p2=new("parameter",name=pnames[2],value=as.numeric(PlogG$par[2]))
	prenames=names(fittedModel@parameters)
	fittedModel@parameters=c(fittedModel@parameters,p1,p2)
	names(fittedModel@parameters)=c(prenames,pnames)
	if(modelingObject@select & length(modelingObject@covr)!=0){
		fittedModel=confi.inter(fittedModel,p1@value,p2@value)		
	}
	return(fittedModel)
}
